package com.test.pattern.mediator;

/**
 * @ClassName: Client
 * @description:
 * @author: Mr du
 * @create: 2024-03-17 16:36
 */
public class Client {

    public static void main(String[] args) {
        //创建中介者对象
        MediatorStructure mediator = new MediatorStructure();

        //创建租房者对象
        Tenant tenant = new Tenant("张三", mediator);
        //创建房主对象
        HouseOwner houseOwner = new HouseOwner("李四", mediator);
        //中介结构要知道房主和租房者
        mediator.setTenant(tenant);
        mediator.setHouseOwner(houseOwner);

        tenant.constact("寻找一套三室一厅的房子");
        houseOwner.constact("我这里有一套三室一厅的房子");
    }
}
